﻿using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NazTek.Extension.Clr4.Test
{        
    /// <summary>
    /// Contains Unit Tests for EnumExtension class public members
    /// </summary>
    [TestClass()]
    public class EnumExtensionTest
    {
        private TestContext testContextInstance;
        /// <summary>
        /// Gets/Sets current test context, e.g., property bag
        /// </summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }
        /// <summary>
        /// Attempts to extract value of a non-existent key test with GetDescription, should return the specified default value
        /// </summary>
        [TestMethod()]
        public void TestGetDescription_MissingWithDefault()
        {
            Assert.AreEqual<string>(StringResource.Default.Data_Default_Null_Override, MockData.DEFAULT_AGE_GROUP.GetDescription("X", StringResource.Default.Data_Default_Null_Override));
        }
        /// <summary>
        /// Attempts to extract value of a non-existent key test with GetDescription, should return null
        /// </summary>
        [TestMethod()]
        public void TestGetDescription_Missing()
        {
            Assert.IsNull(MockData.DEFAULT_AGE_GROUP.GetDescription("X"));
        }
        /// <summary>
        /// Attempts to extract value of a null key test with GetDescription, should return null
        /// </summary>
        [TestMethod()]
        public void TestGetDescription_Null()
        {
            Assert.AreEqual<string>(MockData.DEFAULT_AGE_GROUP.GetDescription(null), MockData.ENUM_ATTRIBUTE_MIDDLEAGED_VALUE);
        }
        /// <summary>
        /// Attempts to extract the first additional into value with GetDescription, should return the first value
        /// </summary>
        [TestMethod()]
        public void TestGetDescription_Default()
        {
            Assert.IsNotNull(MockData.DEFAULT_AGE_GROUP.GetDescription());
        }
        /// <summary>
        /// Attempts to extract the first additional info value with GetDescription, where none exists, should return null
        /// </summary>
        [TestMethod()]
        public void TestGetDescription_MissingDefault()
        {
            Assert.IsNull(MockSalutation.Miss.GetDescription());
        }
        /// <summary>
        /// Attempts to extract the additional info value for a specified key with GetDescription, should return corresponding value
        /// </summary>
        [TestMethod()]
        public void TestGetDescription()
        {
            Assert.AreEqual<string>(MockData.ENUM_ATTRIBUTE_MIDDLEAGED_MINAGE_VALUE, MockData.DEFAULT_AGE_GROUP.GetDescription(MockData.ENUM_ATTRIBUTE_MINAGE_KEY));
        }
        /// <summary>
        /// Attempts to extract the additional info value for a specified key and a specific default value with GetDescription, should return corresponding value
        /// </summary>
        [TestMethod()]
        public void TestGetDescription_WithDefault()
        {
            Assert.AreEqual<string>(MockData.ENUM_ATTRIBUTE_MIDDLEAGED_MINAGE_VALUE, MockData.DEFAULT_AGE_GROUP.GetDescription(MockData.ENUM_ATTRIBUTE_MINAGE_KEY, StringResource.Default.Data_Default_Null_Override));
        }
    }
}
